fix: adapt to new AI Studio login flow - #77
Merged
Merged
Conversation
- Update target URL to new AI Studio app endpoint - Add "Continue to the app" button handler - Remove manual script injection (app has built-in WebSocket client) - Simplify initialization flow for faster startup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add _checkPageErrors() to detect common initialization errors - Add _waitForWebSocketInit() to monitor browser console logs - Detect "System initialization complete" for success - Detect "System initialization failed" for failure - Check for page errors every second during 60s timeout - Auto-refresh page on errors (applet failed, concurrent updates, snapshot failed) - Implement 3-retry mechanism with page refresh between attempts - Apply to both launchOrSwitchContext and attemptLightweightReconnect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er, and ensure consistent flag resets
…t 9998, and update documentation
… at 127.0.0.1:9998
…n-like interaction
1 task
…orrect page loading
ouni3
pushed a commit
to ouni3/AIStudioToAPI
that referenced
this pull request
Aug 20, 2026
* feat: adapt to new AI Studio login flow - Update target URL to new AI Studio app endpoint - Add "Continue to the app" button handler - Remove manual script injection (app has built-in WebSocket client) - Simplify initialization flow for faster startup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add robust WebSocket initialization monitoring and error recovery - Add _checkPageErrors() to detect common initialization errors - Add _waitForWebSocketInit() to monitor browser console logs - Detect "System initialization complete" for success - Detect "System initialization failed" for failure - Check for page errors every second during 60s timeout - Auto-refresh page on errors (applet failed, concurrent updates, snapshot failed) - Implement 3-retry mechanism with page refresh between attempts - Apply to both launchOrSwitchContext and attemptLightweightReconnect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add health monitor initialization and restart logic * refactor: simplify WebSocket initialization monitoring and improve flag handling * refactor: improve WebSocket initialization flow and flag handling * refactor: enhance WebSocket flag initialization, reuse console listener, and ensure consistent flag resets * refactor: deprecate WS_PORT env variable, enforce fixed WebSocket port 9998, and update documentation * chore: remove WS_PORT customization, enforce fixed WebSocket endpoint at 127.0.0.1:9998 * refactor: replace local logger import with class-level logger in ConfigLoader * fix: correct target URL and simplify app ID validation * fix: reorder initialization flow with URL validation after popup handling * fix: skip redundant WebSocket initialization if already completed * fix: reset WebSocket flags before re-navigation to prevent stale state * fix: adjust popup handling order to ensure correct URL validation before interactions * chore: filter out expected WebGL not supported warning in logs * fix: replace page reload with navigation to target URL for improved popup handling * fix: add random mouse movement simulation during wait to enhance human-like interaction * refactor: implement navigation verification and retry mechanism for correct page loading --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文:
由于近期 AIStudio 更新,本分支已调整原有账号登录逻辑,取消了在 blank app 中启动代理的方式(该方式已不支持编辑)。现改为使用开发者预先创建的 app。因此不再支持
WS_PORT环境变量,端口固定为 9998。English:
Due to recent AIStudio updates, this branch has modified the original account login logic. The previous approach of starting the proxy within a blank app (which is no longer editable) has been removed. It now uses a pre-created app provided by the developer. As a result, the
WS_PORTenvironment variable is no longer supported, and the port is fixed at 9998.